package com.lsj.spring.mapper;

import com.lsj.spring.model.TUser;
import org.apache.ibatis.annotations.Mapper;

/**
 * @author Lsj
 * @version 1.0
 * @date 2021/6/26 16:11
 * 添加mapper注解之后,这个接口在编译的时候会生成相应的实现类
 */

@Mapper
public interface TUserMapper {
    /**
     * 按主键删除
     *
     * @param id primaryKey
     * @return deleteCount
     */
    int deleteByPrimaryKey(Integer id);

    /**
     * 插入记录到表
     *
     * @param record the record
     * @return insert count
     */
    int insert(TUser record);

    /**
     * 按主键选择
     *
     * @param id primary key
     * @return object by primary key
     */
    TUser selectByPrimaryKey(Integer id);

    /**
     * 更新记录
     *
     * @param record the updated record
     * @return update count
     */
    int updateByPrimaryKey(TUser record);
}